1. Field of the Invention
The present invention relates to buffer-memory management in a receiver having an error-correction decoder, and, in particular, a forward-error-correction (FEC) decoder.
2. Description of the Related Art
FEC techniques are commonly used in packet-based networks, such as the Internet, to compensate for packet losses. An FEC technique suitable for use with real-time media packets employing the real-time transmission protocol (RTP) is described in U.S. Pat. No. 6,141,788 and in Internet standards track protocol no. RFC-2733, entitled “An RTP Payload Format for Generic Forward Error Correction,” by J. Rosenberg et al., published December 1999 by The Internet Society, each of which is hereby incorporated by reference in its entirety. In accordance with this technique, an additional packet, called a checksum or FEC packet, is added to a media frame, or block of data packets, before transmission. At a receiver, a lost data packet in the frame can be recovered and reconstructed by combining the checksum packet with those data packets that were successfully received. More specifically, the lost data packet is recovered by performing a mathematical operation (e.g., an exclusive- or (XOR) logic operation) on the checksum packet and the successfully received data packets. The lost data packet may then be reconstructed from the results of the mathematical operations.
FIG. 1 depicts a conventional receiver 100 employing FEC decoding according to Internet standards track protocol no. RFC-2733. Receiver 100 includes a packet buffer 104 connected to an FEC decoder 108 and to a play-out buffer 106. FEC decoder 108 is also connected to play-out buffer 106.
FIG. 2 depicts the operation of conventional receiver 100. Operation begins in block 202. In block 204, a received packet 102 is stored in packet buffer 104. In block 206, a copy of packet 102 is transferred to play-out buffer 106; however, packet 102 is retained, in packet buffer 104 for subsequent processing by FEC decoder 108. In block 208, FEC decoder 108 determines whether the media frame F to which packet 102 belongs is ready for FEC decoding (e.g., when an FEC packet and all data packets except one have been received for a given media frame F). If not, operation returns to block 204, where a subsequent packet is received and stored. If, however, frame F is ready for FEC decoding, then, in block 210, FEC decoder 108 reads the received packets (i.e., all but one of the data packets and the FEC packet) for media frame F from packet buffer 104 and performs mathematical operations (e.g., XOR-logic operations) on the received packets. In block 212, FEC decoder 108 reconstructs the missing packet, based on the results of the mathematical operations, in accordance with well-known techniques. In block 214, FEC decoder 108 transfers the recovered packet to play-out buffer 106.
A disadvantage of conventional receiver 100, however, is the relatively large size of packet buffer 104. An MPEG media frame, for example, may have up to 24 data packets plus an FEC packet, for a total of 25 packets. As such, the amount MemPerFrame of buffer memory in packet buffer 104 that is required to store an MPEG media frame may be defined as follows:
  MemPerFrame  =            ∑              j        =        1            25        ⁢          SizeOf      ⁡              (                  Packet          ⁡                      (            j            )                          )            Further, each packet may have a maximum size of the user-datagram-protocol (UDP) maximum packet size (e.g., 1.5 KB, the conventional Ethernet Maximum Transmission Unit (MTU) size). Thus, an MPEG media frame having 25 packets of size 1.5 KB would require 37.5 KB of memory.
In order to store m such frames, the total buffer memory required is (m×MemPerFrame). The number m of frames that must be stored in packet buffer 104 is a function of a number of variables, including (i) the latency of FEC decoder 108 (i.e., the time period between the receipt of a first packet of a frame and the start of FEC decoding for the frame), (ii) the FEC decoding delay (i.e., the time period from the start of FEC decoding to the completion of FEC decoding for the frame, including, e.g., performing 24 sets of XOR-logic operations for the frame), and (iii) the packet jitter of the incoming packets. In conventional receiver 100, the number m of frames to be stored in packet buffer 104 is typically between 12 and 30. Thus, if conventional receiver 100 is designed to receive MPEG media packets, then packet buffer 104 would conventionally require between 450 KB and 1.125 MB of memory.
For the sake of illustration, FIG. 3 graphically depicts an exemplary implementation of packet buffer 104, in which 12 media frames 3021-30212 (having 25 packets each) may be stored.